package edu.maping.easy.fisica;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.jbox2d.common.Vec2;

import processing.core.PApplet;
import processing.core.PGraphics;
import processing.core.PVector;
import edu.maping.easy.model.Point;
import fisica.FPoly;
import fisica.Fisica;

public class EasyMappingFPoly extends FPoly {

	HashMap<Point, Integer> relations = new HashMap<Point, Integer>();

	@Override
	public void draw(PApplet arg0) {
		super.draw(arg0);
	}

	public ArrayList<Point> getVertices() {
		ArrayList<Point> vertexx = new ArrayList<Point>();
		for (int i = 0; i < m_vertices.size(); i++) {
			Vec2 v = Fisica.worldToScreen((Vec2) m_vertices.get(i));

			Point point = new Point((int) (v.x), (int) (v.y));
			vertexx.add(point);
		}
		return vertexx;
	}

	public void preDraw(PGraphics arg0) {
		super.preDraw(arg0);
	}

	public void postDraw(PGraphics graphics) {
		super.postDraw(graphics);
	}

	public ArrayList getVertexx() {
		return m_vertices;
	}

	public void addPointAsVertex(Point point) {
		vertex(point.x, point.y);
		int size = m_vertices.size()-1;
		relations.put(point, size);
	}
}
